package com.inspur.xiaoju.repository;

import com.inspur.xiaoju.model.WorkspaceMember;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface WorkspaceMemberRepository extends MongoRepository<WorkspaceMember, String> {
    List<WorkspaceMember> findByWorkspaceId(String workspaceId);
    List<WorkspaceMember> findByUserId(String userId);
    Optional<WorkspaceMember> findByWorkspaceIdAndUserId(String workspaceId, String userId);
    void deleteByWorkspaceIdAndUserId(String workspaceId, String userId);
    List<WorkspaceMember> findByWorkspaceIdIn(List<String> workspaceIds);
}